
package com.jiuqi.ccp.generator.form;

import java.text.ParseException;
import java.text.SimpleDateFormat;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

/**
 * Form for ccpInfoFunc.
 *
 * @author <a href="http://boss.bekk.no/boss/middlegen/"/>Middlegen</a>
 *
 * @struts.form name="ccpInfoFuncForm"
 */
public class CcpInfoFuncForm extends ActionForm {

   private final static SimpleDateFormat FORMAT = new SimpleDateFormat("dd.MM.yyyy hh:mm:ss");

   private java.lang.String _cifGuid = null;
   private java.lang.String _cibGuid = null;
   private java.lang.String _isAlive = null;
   private java.lang.String _funcName = null;
   private java.lang.String _funcBody = null;
   private java.lang.String _funcBusiSense = null;
   private java.lang.String _funcParamNum = null;

   /**
    * Standard constructor.
    */
   public CcpInfoFuncForm() {
   }

   /**
    * Returns the cifGuid
    *
    * @return the cifGuid
    */
   public java.lang.String getCifGuid() {
      return _cifGuid;
   }

   /**
    * Sets the cifGuid
    *
    * @param cifGuid the new cifGuid value
    */
   public void setCifGuid(java.lang.String cifGuid) {
      _cifGuid = cifGuid;
   }
   /**
    * Returns the cibGuid
    *
    * @return the cibGuid
    */
   public java.lang.String getCibGuid() {
      return _cibGuid;
   }

   /**
    * Sets the cibGuid
    *
    * @param cibGuid the new cibGuid value
    */
   public void setCibGuid(java.lang.String cibGuid) {
      _cibGuid = cibGuid;
   }
   /**
    * Returns the isAlive
    *
    * @return the isAlive
    */
   public java.lang.String getIsAlive() {
      return _isAlive;
   }

   /**
    * Sets the isAlive
    *
    * @param isAlive the new isAlive value
    */
   public void setIsAlive(java.lang.String isAlive) {
      _isAlive = isAlive;
   }
   /**
    * Returns the funcName
    *
    * @return the funcName
    */
   public java.lang.String getFuncName() {
      return _funcName;
   }

   /**
    * Sets the funcName
    *
    * @param funcName the new funcName value
    */
   public void setFuncName(java.lang.String funcName) {
      _funcName = funcName;
   }
   /**
    * Returns the funcBody
    *
    * @return the funcBody
    */
   public java.lang.String getFuncBody() {
      return _funcBody;
   }

   /**
    * Sets the funcBody
    *
    * @param funcBody the new funcBody value
    */
   public void setFuncBody(java.lang.String funcBody) {
      _funcBody = funcBody;
   }
   /**
    * Returns the funcBusiSense
    *
    * @return the funcBusiSense
    */
   public java.lang.String getFuncBusiSense() {
      return _funcBusiSense;
   }

   /**
    * Sets the funcBusiSense
    *
    * @param funcBusiSense the new funcBusiSense value
    */
   public void setFuncBusiSense(java.lang.String funcBusiSense) {
      _funcBusiSense = funcBusiSense;
   }
   /**
    * Returns the funcParamNum
    *
    * @return the funcParamNum
    */
   public java.lang.String getFuncParamNum() {
      return _funcParamNum;
   }

   /**
    * Sets the funcParamNum
    *
    * @param funcParamNum the new funcParamNum value
    */
   public void setFuncParamNum(java.lang.String funcParamNum) {
      _funcParamNum = funcParamNum;
   }


   /**
    * Validate the properties that have been set from this HTTP request,
    * and return an <code>ActionErrors</code> object that encapsulates any
    * validation errors that have been found.  If no errors are found, return
    * <code>null</code> or an <code>ActionErrors</code> object with no
    * recorded error messages.
    *
    * @param mapping The mapping used to select this instance
    * @param request The servlet request we are processing
    */
   public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
      ActionErrors errors = new ActionErrors();
      // test for nullity
      if(getCifGuid() == null) {
         errors.add("cifGuid", new ActionError("error.cifGuid.required"));
      }
      if(getIsAlive() == null) {
         errors.add("isAlive", new ActionError("error.isAlive.required"));
      }
      if(getFuncName() == null) {
         errors.add("funcName", new ActionError("error.funcName.required"));
      }
      if(getFuncBody() == null) {
         errors.add("funcBody", new ActionError("error.funcBody.required"));
      }
      if(getFuncBusiSense() == null) {
         errors.add("funcBusiSense", new ActionError("error.funcBusiSense.required"));
      }
      if(getFuncParamNum() == null) {
         errors.add("funcParamNum", new ActionError("error.funcParamNum.required"));
      }
      // TODO test format/data
      return errors;
   }
}
